using Domain;
using SqlSugar;


namespace Infrastructure.Data
{
    public class SqlSugarInitializer
    {
        private readonly ISqlSugarClient _db;

        public SqlSugarInitializer(ISqlSugarClient db)
        {
            _db = db;
        }

        public void Initialize()
        {
            // 检查并创建数据库表
            _db.CodeFirst.InitTables(
                typeof(MaterialReplenishment),
                typeof(MaterialDetail),
                typeof(Lwp_MaterialRequisition),    
                typeof(Lwp_MaterialRequisitionmx),
                typeof(Lwp_ProductionPlan),
                typeof(ProductionPlanAttachment),
                typeof(ProductionPlanDetail),
                typeof(ProductionPlan),
                typeof(MaterialReplenishmentDetail),
                typeof(Lwp_Cgdd),
                typeof(Lwp_CgddItem)
            );
        }
    }
}